<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/include/page.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>SXT商城</title>
<%@ include file="/common/include/title.jsp"%>
<link type="text/css" href="${rootpath }/css/my.css" rel="stylesheet">
</head>
<body>
	<div id="doc">
		<%@ include file="/common/include/header.jsp"%>
		
		<div id="s_bdw">
		<div id="s_bd">
			
			<div style="margin:10px 0 0 0;"></div>
			
			<div class="breadcrumbs">
				<div class="f-l"><a href="#">首页</a><span>»</span><a href="#">我的易迅</a><span>»</span>我的订单</div>
			</div>
			<%@ include file="/common/include/left_header.jsp" %>
					<div id="s_bdw">
			<div id="s_bd">
				<div class="dl_zc">
					<div class="dl_zc_title">
						<h2 class="f_l">资料修改</h2>
						<div class="rt_bg f_r"></div>
					</div>
					<div class="dl-con cf" id="entry">
						<form id="formlogin" method="post" action="${rootpath }/head/users/usersUpdateSubmit.htm">
							
							<input name="operType" value="${param.operType }" type="hidden"/>
							
							<div class="form" style="width: 600px;">
								<div class="item">
									<span class="label">邮箱：</span>
									<div class="fl">
										
										<input name="email" value="${users.email }" type="text" readonly="readonly" />
									</div>
								</div>
								<!--item end-->
								<c:if test="${param.operType == 'updateInfo'}">
									
									<div class="item">
										<span class="label">手机号：</span>
										<div class="fl">
											${users.phone }(${users.phoneStatusStr })
										</div>
									</div>
									<!--item end-->
									<div class="item">
										<span class="label">qq：</span>
										<div class="fl">
											<input name="qq" value="${users.qq }" type="text"/>


											
										</div>
									</div>
									<!--item end-->
									<!--item end-->
												<div class="item">
													<span class="label">地区:</span>
													<div class="fl">
														${requestScope.users.region.treeName }
														<input type="button" value="修改地区" onclick="return $('#regionDiv').show()"/>
													</div>
												</div>
												<!--item end-->
												<div class="item">
													<span class="label">:</span>
													<div class="fl">
														<input type="hidden" id="regionId" name="regionId" value="${requestScope.users.regionId}"/>
														<div id="regionDiv" style="display: none">
															<select id="regionId1" onchange="return selectRegionList('regionId1','regionId2','regionId')"></select>
															<select id="regionId2" onchange="return selectRegionList('regionId2','regionId3','regionId')"></select>
															<select id="regionId3" onchange="return selectRegionList('regionId3','regionId4','regionId')"></select>
														</div>
														<span class="clear"></span>
													</div>
												</div>
									<!--item end-->
									<div class="item">
										<span class="label">详细地址：</span>
										<div class="fl">
											
											<input name="address" value="${users.address }" type="text"/>
										</div>
									</div>
									<!--item end-->
									<div class="item">
										<span class="label">头像：</span>
										<div class="fl">
											${users.photoPath}
										</div>
									</div>
									<!--item end-->
									<div class="item">
										<span class="label">上次登录时间：</span>
										<div class="fl">
											<fmt:formatDate value="${users.lastLoginTime }" pattern="yyyy-MM-dd HH:mm:ss"/>
											
										</div>
									</div>
								</c:if>
								<c:if test="${param.operType == 'updatePass'}">
									<div class="item">
										<span class="label">原密码：</span>
										<div class="fl">
											<input name="password" value="" type="text"/>
										</div>
									</div>
									<!--item end-->
									<div class="item">
										<span class="label">新密码：</span>
										<div class="fl">
										
											<input name="password1" value="" type="text"/>
										</div>
									</div>
									<!--item end-->
									<div class="item">
										<span class="label">确认密码：</span>
										<div class="fl">
										
											<input name="password2" value="" type="text"/>
										</div>
									</div>
									<!--item end-->
								
								
								</c:if>
								
								
										<div class="item">
											<span class="label">&nbsp;</span>
											<span class="error_info">
												${info }
											</span>
										</div>
									<!--item end-->
								
								
								<div class="item">
										<span class="label">&nbsp;</span>
										<div class="fl">
											<input  type="submit" value="提交" style="background-color: lightblue;width: 70px;height: 35px;"/>
										</div>
									</div>
									<!--item end-->
								
							</div>
							<!--form end-->

							<div class="clear"></div>
						</form>
					</div>
					<!--regist end-->
				</div>
				<!--dl_zc end-->
				<script type="text/javascript" src="${rootpath}/js/Validate.js"></script>
				<script type="text/javascript"
					src="${rootpath}/js/Validate.entry.js"></script>
			</div>
			<!--s_bd end-->
		</div>
		<!--s_bdw end-->
			<div class="clear"></div>
			
		</div><!--s_bd end-->
	</div>
		
		<%@ include file="/common/include/footer.jsp"%>
	</div>
</body>
</html>

<c:if test="${param.operType=='updateInfo' }">
	
	<script type="text/javascript">
		function selectRegionList(currSelectId,tarSelectId,regionId)
		{
			var currSelect=$("#"+currSelectId);
			var parentId="0";
			if(currSelect.length ==1)
			{
				parentId=currSelect.val();
			}
			$("#" + regionId).val(parentId);
			if($("#"+tarSelectId).length==0)
			{
				return;	
			}
			
			
			$.post("${rootpath}/outer/regionList.htm",
					"json={'version':'1','data':{'parentId':'"+parentId+"'}}",
					function(data)
					{
						
						if(data.code==0)
						{
							var sb="<option value='0'>请选择</option>";
							//alert(data.data.regionList.length);
							for(var i=0;i<data.data.regionList.length;i++)
							{
								var region=data.data.regionList[i];
							//alert(region.name);
								
								
								sb+="<option value='"+region.id+"'>"+region.name+"</option>";
								
								
							}
						
							$("#"+tarSelectId).html(sb);
						
						
						
						}
				
						
				
				
				
					},
			
					"json"
			
			
			
			
			
			
			
			);
			
			
			
			
			
		}
	
	
		selectRegionList("0","regionId1");
		
	
	
	
	</script>

</c:if>

